<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>PaginatedItemsControlApplication.mxml</title>
<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/>
</head>

<body><pre><span class="MXMLProcessing_Instruction">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</span>
<span class="MXMLComponent_Tag">&lt;mx:Application</span><span class="MXMLDefault_Text"> 
    layout=&quot;</span><span class="MXMLString">vertical</span><span class="MXMLDefault_Text">&quot;
    creationComplete=&quot;</span><span class="ActionScriptDefault_Text">onCreationComplete</span><span class="ActionScriptBracket/Brace">(</span>50<span class="ActionScriptBracket/Brace">)</span>;<span class="MXMLDefault_Text">&quot;
    
    viewSourceURL=&quot;</span><span class="MXMLString">srcview/PaginatedItemsControlBase/index.html</span><span class="MXMLDefault_Text">&quot;
    
    xmlns:mx=&quot;</span><span class="MXMLString">http://www.adobe.com/2006/mxml</span><span class="MXMLDefault_Text">&quot; xmlns:controls=&quot;</span><span class="MXMLString">controls.*</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
    
    <span class="MXMLSpecial_Tag">&lt;mx:Script&gt;</span>
        <span class="ActionScriptOperator">&lt;!</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">CDATA</span><span class="ActionScriptBracket/Brace">[</span>
            
            <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onCreationComplete</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">num</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">a</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">[]</span>;
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">obj</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Object</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">{}</span>;
                
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span>;
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">l</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">num</span>;
                <span class="ActionScriptReserved">for</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">i</span>; <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">l</span>; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">++</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">obj</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">{}</span>;
                    <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;list item &quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptOperator">+</span> 1<span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptDefault_Text">obj</span>.<span class="ActionScriptDefault_Text">data</span> <span class="ActionScriptOperator">=</span> 1000 <span class="ActionScriptOperator">*</span> <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">+</span> 1;
                    
                    <span class="ActionScriptDefault_Text">a</span>.<span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">obj</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
                <span class="ActionScriptDefault_Text">_dp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">a</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span>
            <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_dp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">[]</span>;
            
            <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span>
            <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_state_dp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">[</span>
                <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;base&apos;</span>, <span class="ActionScriptDefault_Text">data</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">}</span>,
                <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;min&apos;</span>, <span class="ActionScriptDefault_Text">data</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;minimum_state&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;max&apos;</span>, <span class="ActionScriptDefault_Text">data</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;maximum_state&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
            <span class="ActionScriptBracket/Brace">]</span>;
        <span class="ActionScriptBracket/Brace">]]</span><span class="ActionScriptOperator">&gt;</span>
    <span class="MXMLSpecial_Tag">&lt;/mx:Script&gt;</span>
    
    <span class="MXMLComponent_Tag">&lt;mx:Panel</span><span class="MXMLDefault_Text"> width=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">&quot; title=&quot;</span><span class="MXMLString">PaginatedItemsControlBase Implementation Example</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
        
        <span class="MXMLComponent_Tag">&lt;mx:Form&gt;</span>
            
            <span class="MXMLComponent_Tag">&lt;mx:FormItem</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">num of items</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;mx:HSlider</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">numResults_hs</span><span class="MXMLDefault_Text">&quot; minimum=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; maximum=&quot;</span><span class="MXMLString">100</span><span class="MXMLDefault_Text">&quot; snapInterval=&quot;</span><span class="MXMLString">5</span><span class="MXMLDefault_Text">&quot; change=&quot;</span><span class="ActionScriptDefault_Text">onCreationComplete</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">numResults_hs</span>.<span class="ActionScriptDefault_Text">value</span><span class="ActionScriptBracket/Brace">)</span>;<span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:FormItem&gt;</span>
            
            <span class="MXMLComponent_Tag">&lt;mx:FormItem</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">items per page</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;mx:HSlider</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">itemsPerPg_hs</span><span class="MXMLDefault_Text">&quot; minimum=&quot;</span><span class="MXMLString">2</span><span class="MXMLDefault_Text">&quot; value=&quot;</span><span class="MXMLString">5</span><span class="MXMLDefault_Text">&quot; maximum=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; snapInterval=&quot;</span><span class="MXMLString">1</span><span class="MXMLDefault_Text">&quot; change=&quot;</span><span class="ActionScriptDefault_Text">items_pgic</span>.<span class="ActionScriptDefault_Text">itemsPerPage</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">itemsPerPg_hs</span>.<span class="ActionScriptDefault_Text">value</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:FormItem&gt;</span>
            
            <span class="MXMLComponent_Tag">&lt;mx:FormItem</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">list of items</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;mx:List</span><span class="MXMLDefault_Text"> dataProvider=&quot;</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">items_pgic</span>.<span class="ActionScriptDefault_Text">selectedItems</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">150</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">250</span><span class="MXMLDefault_Text">&quot; labelField=&quot;</span><span class="MXMLString">label</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:FormItem&gt;</span>
            
            <span class="MXMLComponent_Tag">&lt;mx:FormItem</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">paginated items control subclass</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;controls:PaginatedItemsControl</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">items_pgic</span><span class="MXMLDefault_Text">&quot; itemsPerPage=&quot;</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">itemsPerPg_hs</span>.<span class="ActionScriptDefault_Text">value</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">&quot; dataProvider=&quot;</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">_dp</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:FormItem&gt;</span>
            
            <span class="MXMLComponent_Tag">&lt;mx:FormItem</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">control state</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
                <span class="MXMLComponent_Tag">&lt;mx:ComboBox</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">state_cb</span><span class="MXMLDefault_Text">&quot; dataProvider=&quot;</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">_state_dp</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">&quot; change=&quot;</span><span class="ActionScriptDefault_Text">items_pgic</span>.<span class="ActionScriptDefault_Text">currentState</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">state_cb</span>.<span class="ActionScriptDefault_Text">selectedItem</span>.<span class="ActionScriptDefault_Text">data</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
            <span class="MXMLComponent_Tag">&lt;/mx:FormItem&gt;</span>
        
        <span class="MXMLComponent_Tag">&lt;/mx:Form&gt;</span>
        
    <span class="MXMLComponent_Tag">&lt;/mx:Panel&gt;</span>
    
<span class="MXMLComponent_Tag">&lt;/mx:Application&gt;</span></pre></body>
</html>
